//
// Created by benxb on 2021/12/21.
//

#ifndef BENXDB_LINEAR_INDEX_SEGMENT_READER_H
#define BENXDB_LINEAR_INDEX_SEGMENT_READER_H

#include <index/linear_index_segment.h>

namespace benxdb {

class LinearIndexSegmentReader {
public:
    explicit LinearIndexSegmentReader(const std::shared_ptr<LinearIndexSegment>& segment);

    ~LinearIndexSegmentReader();

    bool HasMoreIndex();

    LinearIndexLeafPair GetNextIndexPair();

private:
    uint32_t page_index_;
    uint32_t record_index_;
    LinearIndexPage page_;
    std::shared_ptr<LinearIndexSegment> segment_;
};

}

#endif //BENXDB_LINEAR_INDEX_SEGMENT_READER_H
